/*
 * Copyright (c) 2006, 2022, webrx.cn All rights reserved.
 *
 */
package cn.webrx;

import java.util.Arrays;
import java.util.Random;

/**
 * <p>Project: jse2204 - Ex1
 * <p>Powered by webrx On 2022-09-06 17:10:48
 *
 * @author webrx [webrx@126.com]
 * @version 1.0
 * @since 17
 */
public class Ex1 {
    public static void main(String[] args) {
        //生成1-33 之间的6个随机数，不能重复
        int[] reds = new int[6];
        Random rand = new Random();
        for (int j = 0; j < 20; j++) {
            int i = 0;
            while (true) {
                int t = rand.nextInt(1, 33);
                boolean f = true;
                for (int n : reds) {
                    if (n == t) {
                        f = false;
                        break;
                    }
                }
                if (f) {
                    reds[i++] = t;
                }
                if (i == 6) {
                    break;
                }
            }
            Arrays.sort(reds);
            System.out.println(Arrays.toString(reds));
        }
    }

}
